package com.cldz.controller;


import com.cldz.common.dto.req.AreaDto;
import com.cldz.feign.UserFeign;
import com.cldz.service.UserService;
import com.cldz.response.support.ServerResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ Author     ：lixiao.
 * @ Date       ：Created in 14:02 2018/12/20
 * @ Description：
 * @ Modified By：
 */
@Slf4j
@RestController
public class UserController implements UserFeign {

    @Autowired
    private UserService userService;

    /**
     * 获取用户所属区域
     * @param userID
     * @return
     */
    @GetMapping("/userPermissionArea/{userID}")
    public ServerResponse getUserPermissionArea(@PathVariable(name = "userID") Integer userID){
        AreaDto userPermissionArea = userService.getUserPermissionArea(userID);
        return ServerResponse.createDataList(userPermissionArea);
    }

}
